package router

import (
	"github.com/gin-gonic/gin"
	"mxshop_api/order_web/api/order"
	"mxshop_api/order_web/api/pay"
	"mxshop_api/order_web/middlewares"
)

func OrderRouter(group *gin.RouterGroup) {
	OrderRouter := group.Group("orders").Use(middlewares.JWTAuth(), middlewares.Trace())
	{
		OrderRouter.GET("", order.List)
		OrderRouter.POST("", order.New)
		OrderRouter.GET("/:id", order.Detail)
	}

	PayRouter := group.Group("pay")
	{
		PayRouter.POST("alipay/notify", pay.Notify)
		PayRouter.GET("alipay/notify", pay.Notify)
	}
}
